//
//  Brands_BrandsMainBrandSpecia_Cell_WX.m
//  ZITHER
//
//  Created by weixin on 2019/4/11.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Brands_BrandsMainBrandSpecia_Cell_WX.h"
#import "Brands_BrandsDetail_VC_WX.h"

@implementation Brands_BrandsMainBrandSpecia_Cell_WX

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.backgroundColor = HexColor(0xf5f5f5);
    self.viewBorder.backgroundColor = [UIColor whiteColor];
    [self.viewBorder setCornerRadiusWithRadius:10 isMasks:YES];
    [self.viewBorder mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(10);
        make.left.equalTo(self).offset(14);
        make.right.equalTo(self).offset(-14);
        make.bottom.equalTo(self).offset(0);
    }];
    
    [self setMasonry];

}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    Brands_BrandsDetail_VC_WX *vc = [[Brands_BrandsDetail_VC_WX alloc]init];
    vc.BrindId = self.model.id;
    [self.getNav pushViewController:vc animated:YES];
}

-(void)setMasonry{
    
    [self addSubview:self.typeLab];
    [self addSubview:self.recommendLab];
    [self addSubview:self.brandLab];
    [self addSubview:self.modelLab];
    [self addSubview:self.pic];
    
    [self.brandLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(35);
        make.top.equalTo(self).offset(35);
        make.height.mas_equalTo(17);
    }];
    [self.modelLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(35);
        make.top.equalTo(self.brandLab.mas_bottom).offset(10);
        make.height.mas_equalTo(14);
    }];
    [self.typeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(35);
        make.top.equalTo(self.modelLab.mas_bottom).offset(30);
        make.height.mas_equalTo(14);
    }];
    [self.recommendLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(35);
        make.right.equalTo(self).offset(-35);

        make.top.equalTo(self.typeLab.mas_bottom).offset(10);
        make.height.mas_equalTo(14);
        make.bottom.equalTo(self).offset(-30);
    }];

    [self.pic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-35);
        make.top.equalTo(self).offset(35);
        make.height.mas_equalTo(45);
        make.width.mas_equalTo(80);
    }];
}




- (BaseLab *)typeLab{
    if (!_typeLab) {
        _typeLab = [BaseLab initCustomLab:@"标签标签标签" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
    }
    return _typeLab;
}

- (BaseLab *)recommendLab{
    if (!_recommendLab) {
        _recommendLab = [BaseLab initCustomLab:@"介绍介绍介绍介绍" color:HexColor(0x999999) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
    }
    return _recommendLab;
}

- (BaseLab *)brandLab{
    if (!_brandLab) {
        _brandLab = [BaseLab initCustomLab:@"Patek Philippe-品牌" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:15]];
    }
    return _brandLab;
}

- (BaseLab *)modelLab{
    if (!_modelLab) {
        _modelLab = [BaseLab initCustomLab:@"百达斐丽-型号" color:HexColor(0x0d0d0d) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
    }
    return _modelLab;
}

- (BaseImageV *)pic{
    if (!_pic) {
        _pic = [[BaseImageV alloc]initializeFrame:CGRectMake(0, 0, 0, 0) contentMode:0];
        _pic.backgroundColor = [UIColor redColor];
    }
    return _pic;
}


-(void)setModel:(GoodsBrandTagstModel *)model{
    _model = model;
    self.brandLab.text = model.brandName;
    self.modelLab.text = model.brandNameNative;
    [self.pic sd_setImage:model.brandLogo];
    self.typeLab.text = [NSString stringWithFormat:@"%@·%@",model.country,model.establishDate];
    self.self.recommendLab.text = model.logan;

}



@end
